package vip.specimen.system.controller.log;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.specimen.system.common.annotation.SystemJurisdiction;
import vip.specimen.system.datasource.entity.SystemLogEntity;
import vip.specimen.system.result.JsonResult;
import vip.specimen.system.service.SystemLogService;

import javax.annotation.Resource;

/**
 * *@Author: 余浪人
 * *@Date：2021/3/16 11:46
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Api(tags = "日志管理")
@RestController
@RequestMapping(value = "log")
public class LogController {
    @Resource
    private SystemLogService logSerivce;

    @GetMapping
    @ApiOperation(value = "查看", notes = "获取操作日志列表")
    @RequiresPermissions(value = "log:manage:select")
    @SystemJurisdiction(resourceType = "button", permissionName = "查看操作日志")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页码", dataType = "int"),
            @ApiImplicitParam(name = "pageSize", value = "每页记录条数", dataType = "int")
    })
    public JsonResult<Page<SystemLogEntity>> findLogAll() {
        return JsonResult.success(this.logSerivce.findLogAll());
    }
}
